package com.liy.cloud.common.utils;
/**
 * @Auther: libs
 * @Date: 2018/8/10 10:24
 * @Description: 日期类型枚举
 */
public enum DateType {
    SIMPLE_DATE("yyyy-MM-dd", "[0-9]{4}-[0-9]{2}-[0-9]{2}"),
    FULL_DATE_24H("yyyy-MM-dd HH:mm:ss", "[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}"),
    FULL_DATE_12H("yyyy-MM-dd hh:mm:ss a", "[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} [AM|PM]"),
    TIMESTAMP("timestamp", "\\d+"),
    NO_VALIDATE("no-validate", ".*");
    /*
     * 日期格式
     */
    private String pattern;
    /*
     * 验证日期的正则表达式
     */
    private String regex;
    private DateType(String pattern, String regex){
        this.pattern = pattern;
        this.regex = regex;
    }

    public String getPattern() {
        return pattern;
    }

    public String getRegex() {
        return regex;
    }
}
